package oa.hleast.xswl.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ActivityType2CreditOperatingEnum {

    //    2培训签到
    TRAINING_SIGN_IN("A_0005", CreditOperatingAndRuleEnum.TRAINING_SIGN_IN),
    //    3场馆预约
    VENUE_RESERVATION("A_0004", CreditOperatingAndRuleEnum.VENUE_RESERVATION),
    //    5垂钓预约
    FISHING_RESERVATION("A_0005", CreditOperatingAndRuleEnum.FISHING_RESERVATION),
    //    6图书馆活动
    LIBRARY_ACTIVITIES("A_0002", CreditOperatingAndRuleEnum.LIBRARY_ACTIVITIES),
    //    7文化馆活动
    CULTURAL_CENTER_ACTIVITIES("A_0003", CreditOperatingAndRuleEnum.CULTURAL_CENTER_ACTIVITIES);

    private String activityCode;
    private CreditOperatingAndRuleEnum creditOperatingAndRuleEnum;

    public static CreditOperatingAndRuleEnum getEnumByCode(String activityCode) {
        for (ActivityType2CreditOperatingEnum value : ActivityType2CreditOperatingEnum.values()) {
            if (value.getActivityCode().equals(activityCode)) {
                return value.getCreditOperatingAndRuleEnum();
            }
        }
        return null;
    }
}
